package com.maiji.cloud.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.maiji.cloud.entities.shopingmall.DistributionLogEntity;

@Mapper
public interface DistributionLogMapper extends BaseMapper<DistributionLogEntity> {

	/**
	 * 分销明细
	 */
	List<DistributionLogEntity> selectDistributionLogList(@Param("userId")String userId,@Param("level")Integer level,@Param("start")Integer start
			,@Param("limit")Integer limit,@Param("startTime")String startTime,@Param("endTime")String endTime);

	/**
	 * 获得分销总金额
	 * @param userId
	 * @param level
	 * @return
	 */
	Double getDistributionSumMoney(@Param("userId")String userId,@Param("level")Integer level);
	
	/**
	 * 根据订单id查询和等级查询
	 */
	DistributionLogEntity getDistributionLogByOrderId(@Param("orderId")String orderId,@Param("level")Integer level);

}
